package gui;

import java.awt.EventQueue;

import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.event.*;

public class SwingTest{

	private JFrame frame;
	private JLabel lblSwing;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					SwingTest window = new SwingTest();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public SwingTest() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 450, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JPanel panel = new JPanel();
		frame.getContentPane().add(panel, BorderLayout.NORTH);
		
		lblSwing = new JLabel("");
		lblSwing.setLabelFor(frame);
		panel.add(lblSwing);
		
		
		JButton btnImScrewed = new JButton("I'm screwed");
		panel.add(btnImScrewed);
		
		btnImScrewed.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				setLabelTest("Shit");
			}
		});
	}
	
	public void setLabelTest(String strCaption){
		lblSwing.setText(strCaption);
	}

}
